from applications.extensions import ma
from marshmallow import fields


# 权限models序列化类
# class PowerOutSchema(ma.Schema):
#     id = fields.Integer()
#     title = fields.Str(attribute="name")
#     type = fields.Str()
#     code = fields.Str()
#     href = fields.Str(attribute="url")
#     openType = fields.Str(attribute="open_type")
#     parent_id = fields.Integer()
#     icon = fields.Str()
#     sort = fields.Integer()
#     create_time = fields.DateTime()
#     update_time = fields.DateTime()
#     enable = fields.Integer()


class MmberRoleSchema2(ma.Schema):  # 序列化类
    parentId = fields.Str(attribute="id")
    rolename = fields.Str(attribute="rolename")
